﻿using System;
using System.Text.RegularExpressions;

namespace ProjectMadaktariMVC.Validators
{

    public class PhoneValidator
    {
        //Matches a number like 255-777-333-444
        private static Regex phoneRegex = new Regex("^\\d{3}-\\d{3}-\\d{3}-\\d{3}$");

        public static bool IsValid(string number)
        {
            return phoneRegex.IsMatch(number);
        }
    }
}
